//
//  MGTableView.h
//  Mango
//
//  Created by 胡超 on 2017/11/29.
//  Copyright © 2017年 胡超., ltd. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MGTableViewSection.h"

NS_ASSUME_NONNULL_BEGIN

@interface MGTableView : UITableView <UITableViewDataSource,UITableViewDelegate>

@property (nonatomic,readonly) MGTableViewOption *option;
@property (nonatomic,readonly) NSArray <MGTableViewSection *> *sections;

@property (nonatomic,weak) id<UIScrollViewDelegate> scrollViewDelegate;

- (void)addSection:(void(^)(MGTableViewSection *section))sectionConfiguration;
- (void)insertSectionAtIndex:(NSUInteger)sectionIndex sectionConfiguration:(void(^)(MGTableViewSection *section))sectionConfiguration;

#pragma mark - Update Cell

- (void)updateCellImage:(nullable UIImage *)image forIndexPath:(NSIndexPath *)indexPath;
- (void)updateCellTitle:(nullable NSString *)title forIndexPath:(NSIndexPath *)indexPath;
- (void)updateCellDetail:(nullable NSString *)detail forIndexPath:(NSIndexPath *)indexPath;
- (void)updateCellSwitchOn:(BOOL)on animated:(BOOL)animated forIndexPath:(NSIndexPath *)indexPath;
- (void)updateCellSwitchEnable:(BOOL)enable forIndexPath:(NSIndexPath *)indexPath;

@end

NS_ASSUME_NONNULL_END

